package com.chb.fallback.backFactory;

import com.chb.thread.FirstService;
import com.chb.fallback.serviceBackImpl.FirstServiceBack;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author CHB
 * @createTime 2022-8-15 13:15
 */
@Slf4j
@Component
public class FirstServiceBackFactory implements FallbackFactory<FirstService> {
    @Override
    public FirstService create(Throwable throwable) {
        log.warn("调用失败（；´д｀）ゞ ,message: "+throwable.getMessage());
        return new FirstServiceBack();
    }
}
